#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from print_r import print_r
import lazyxml

s = {
    'notify_id'         :   '1111111111111111111111',
    'custom_id'         :   '1356765333',
    'out_order_code'    :   '111111111',
    'warehouse_code'    :   'KU-004',
    'logistics_code'    :   'STO',
    'logistics_name'    :   '',
    'logistics_no'      :   '2222222',
    'weight'            :   2.3,
    'volume'            :   3,
    'status_code'       :   'WMS_PACKAGE',
    'status_info'       :   '已打包',
    'remark'            :   '<备注>',
    'create_time'       :   '2011-08-12 17:36:24',
    'items'             :   {
        'item'      :       [
            {
                'item_line_num'     :   1,
                'item_code'         :   '123456',
                'good_num'          :   5,
                'bad_num'           :   0,
            },
            {
                'item_line_num'     :   1,
                'item_code'         :   '123456',
                'good_num'          :   5,
                'bad_num'           :   0,
            }
        ]
    }
}

#print lazyxml.dump(s,'dump.xml')

file = 'dump.xml'
#print lazyxml.load(file)

d = 'e '
s = '''
<RequestInterface_Order><Remark_2><![CDATA[]]></Remark_2><CompID><![CDATA[1100000381]]></CompID><LineCount><![CDATA[2000]]></LineCount><OutInFlag><![CDATA[0]]></OutInFlag><VendeeCode><![CDATA[]]></VendeeCode><Sign_Code><![CDATA[1435383131-b4f2677a4d8bb5e964ee24a4ff2bb1ad]]></Sign_Code><StockID_T><![CDATA[BMS1]]></StockID_T><CustID><![CDATA[1300000495]]></CustID><Cust_OrderCode><![CDATA[I201201100004]]></Cust_OrderCode><Orderitems><Orderitem><Item>1</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004003]]></Sku_ProductNo></Orderitem><Orderitem><Item>2</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004004]]></Sku_ProductNo></Orderitem><Orderitem><Item>3</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004005]]></Sku_ProductNo></Orderitem><Orderitem><Item>4</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004006]]></Sku_ProductNo></Orderitem><Orderitem><Item>5</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004007]]></Sku_ProductNo></Orderitem><Orderitem><Item>6</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004008]]></Sku_ProductNo></Orderitem><Orderitem><Item>7</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004009]]></Sku_ProductNo></Orderitem><Orderitem><Item>8</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004010]]></Sku_ProductNo></Orderitem><Orderitem><Item>9</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004011]]></Sku_ProductNo></Orderitem><Orderitem><Item>10</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004012]]></Sku_ProductNo></Orderitem><Orderitem><Item>11</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004013]]></Sku_ProductNo></Orderitem><Orderitem><Item>12</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004014]]></Sku_ProductNo></Orderitem><Orderitem><Item>13</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004015]]></Sku_ProductNo></Orderitem><Orderitem><Item>14</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004016]]></Sku_ProductNo></Orderitem><Orderitem><Item>15</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004017]]></Sku_ProductNo></Orderitem><Orderitem><Item>16</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004018]]></Sku_ProductNo></Orderitem><Orderitem><Item>17</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004019]]></Sku_ProductNo></Orderitem><Orderitem><Item>18</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004020]]></Sku_ProductNo></Orderitem><Orderitem><Item>19</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004021]]></Sku_ProductNo></Orderitem><Orderitem><Item>20</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004022]]></Sku_ProductNo></Orderitem><Orderitem><Item>21</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004023]]></Sku_ProductNo></Orderitem><Orderitem><Item>22</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004024]]></Sku_ProductNo></Orderitem><Orderitem><Item>23</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004025]]></Sku_ProductNo></Orderitem><Orderitem><Item>24</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004026]]></Sku_ProductNo></Orderitem><Orderitem><Item>25</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004027]]></Sku_ProductNo></Orderitem><Orderitem><Item>26</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004028]]></Sku_ProductNo></Orderitem><Orderitem><Item>27</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004029]]></Sku_ProductNo></Orderitem><Orderitem><Item>28</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004030]]></Sku_ProductNo></Orderitem><Orderitem><Item>29</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004031]]></Sku_ProductNo></Orderitem><Orderitem><Item>30</Item><Qty><![CDATA[100]]></Qty><Sku_Name><![CDATA[鞋子]]></Sku_Name><Sku_UnitPrice><![CDATA[100.000]]></Sku_UnitPrice><Sku_ProductNo><![CDATA[SP00000004032]]></Sku_ProductNo></Orderitem></Orderitems><PlanID_T><![CDATA[BJDX]]></PlanID_T></RequestInterface_Order>
'''
print_r(lazyxml.loads(s,1))